﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="Bios32"
	type="http://metalx.org/System/Bios32"
	static="true"
	xmlns="http://metalx.org/Program"
	xmlns:cls="http://metalx.org/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:date="http://metalx.org/i386/Functions/Date"
	xmlns:time="http://metalx.org/i386/Functions/Time"
	xmlns:clk="http://metalx.org/i386/Functions/Clock"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:lst="http://metalx.org/i386/Functions/List"
	xmlns:pcif="http://metalx.org/i386/Functions/Pci"
	xmlns:hex="http://metalx.org/i386/Functions/Hexadecimal"
	xmlns:mm="http://metalx.org/i386/Functions/MemoryManager"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:ari="http://metalx.org/Intel/80386/Arithmetic"
	xmlns:shift="http://metalx.org/Intel/80386/Shift"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate"
	xmlns:usb="http://metalx.org/Usb/Ohci/Registers"
	xmlns:pci="http://metalx.org/Pc/Pci/Ports"
	xmlns:cfg="http://metalx.org/Pc/Pci/Configuration">

	<cls:method name="FindServiceDirectory" type="http://metalx.org/Hexadecimal" static="true">
		<cpu:CopyImmediateToSI/>
		<hex>000e0000</hex>

		<label id="next"/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<cpu:CompareAXToImmediate/>
		<string>_32_</string>

		<cpu:BranchToRelative8IfEqual/>
		<addressOf ref="createObject" type="Relative8"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToSIRegister/>
		<byte>16</byte>

		<cpu:JumpToRelative8/>
		<addressOf ref="next" type="Relative8"/>

		<label id="createObject"/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-AXRegister/>

		<hex:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetServiceDirectoryLength" type="http://metalx.org/Integer" static="true">
		<cpu:CopyImmediateToSI/>
		<hex>000e0000</hex>

		<label id="next"/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<cpu:CompareAXToImmediate/>
		<string>_32_</string>

		<cpu:BranchToRelative8IfEqual/>
		<addressOf ref="createObject" type="Relative8"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToSIRegister/>
		<byte>16</byte>

		<cpu:JumpToRelative8/>
		<addressOf ref="next" type="Relative8"/>

		<label id="createObject"/>

		<cpu:CopyImmediateToAX/>
		<int>0</int>

		<cpu:CopyOperandToRegister8/>
		<op:AL-SIAddressPlusImmediate8/>
		<byte>9</byte>

		<int:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>